package controller

import (
	"github.com/gin-gonic/gin"
	"start/app/user/api/controller/vo"
	//swaggerFiles "github.com/swaggo/files"
	//ginSwagger "github.com/swaggo/gin-swagger"
)

type health struct {
	Controller
}

// 健康检测
//	@Summary		检测服务是否可用
//	@Description	通过调用改接口，可检测出服务是否可用
//	@Tags			health
//	@Accept			json
//	@Produce		json
//	@Success		200	{object}	vo.Body	"请求成功"
//	@Failure		500	{object}	vo.Body	"内部错误"
//	@Router			/health [get]
func (controller health) get(c *gin.Context) {
	c.JSON(controller.send(vo.Body{Data: "ok"}))
}

func NewHealth(router *gin.Engine) {
	c := health{}

	// http://localhost:8080/health
	router.GET("/health", c.get)
}
